package cn.edu.scau.cmi.liujianxun.client.fxUI.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import cn.edu.scau.cmi.liujianxun.spring.domain.Student;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;

public class SpringDemoController {
	@FXML
	private TextArea ta;
	@FXML
	private Button btShow;

	public void btshow(ActionEvent event) {
		ApplicationContext context = new ClassPathXmlApplicationContext("cn/edu/scau/cmi/liujianxun/spring/applicationContext.xml");
        Student s = (Student)context.getBean("liujianxun");
        ta.appendText(s.getName() + "的导师是" + s.getTutor().getName() + "\n");
	}
}
